﻿<%@ Page Title=""  Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    Inherits="Nivdal.Bookmarks"  StylesheetTheme="SkinFile" CodeBehind="Bookmarks.aspx.cs" %>

<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_PageNameLabel %>"
        CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    
    <div class="basic_element">
    <asp:Label ID="Message" runat="server" Text="" SkinID="ConfirmLabel"></asp:Label>
    <div class="red_title">
        <asp:Label ID="PlayersLabel" runat="server" Text='<%$ Resources:Resource, Global_Players %>' CssClass="white_title"></asp:Label>
        
    </div>
    <div class="padding5">
           <asp:GridView ID="PlayersGridView" runat="server" DataSourceID="PlayersSqlDataSource"
            SkinID="Professional" OnRowCommand="DeletePlayer" AutoGenerateColumns="false"
            OnRowCreated="PlayersGridView_OnRowCreated" AllowPaging="true" PageSize="10" Font-Size="13px">
            <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
            <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
            <Columns>
                <asp:BoundField DataField="BookmarkId" Visible="true" />
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="PlayerNameLabel" runat="server" Text="<%$ Resources:Resource, Global_PlayerName %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="PlayersHyperLink" runat="server" Text='<%# Eval("PlayerName") %>'
                            NavigateUrl='<%# Eval("PlayerId", "Player.aspx?Id={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-Width="5%">
                    <ItemTemplate>
                        <asp:ImageButton ID="DeletePlayerLinkButton" runat="server" OnClientClick='<%# DeleteBookMarkButtonOnClientClick()%>'
                            CommandArgument="<%#((GridViewRow) Container).RowIndex %>" CommandName="DeletePlayer"
                            ImageUrl="~/Images/Icons/delete.png" ToolTip="<%$ Resources:Resource, Global_Delete %>">
                        </asp:ImageButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="NoPlayerYetLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_NoPlayerYetLabel %>"></asp:Label>
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="PlayersSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetBookmarkedPlayers" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
    </div>
    </div>
 
    <div class="basic_element">
    <div class="red_title">
        <asp:Label ID="MatchesLabel" runat="server" Text='<%$ Resources:Resource, Global_Matches %>' CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <asp:GridView ID="MatchesGridView" runat="server" DataSourceID="MatchesSqlDataSource"
        OnRowCommand="DeleteMatch" SkinID="Professional" AutoGenerateColumns="False"
        AllowPaging="True" Font-Size="13px" EnableTheming="True" OnRowCreated="MatchesGridView_OnRowCreated">
        <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
            Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
        <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
        <Columns>
            <asp:BoundField DataField="BookmarkId" Visible="true" />
            <asp:TemplateField ItemStyle-Width="50%">
                <HeaderTemplate>
                    <asp:Label ID="MatchTitleLabel" runat="server" Text='<%# Resources.Resource.Global_Matches+ ":"%>'> </asp:Label>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:HyperLink ID="PlayersHyperLink" runat="server" Text='<%# Eval("MatchTitle") %>'
                        NavigateUrl='<%# Eval("MatchId", "MatchPage.aspx?MatchId={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="MatchResult" HeaderText="<%$ Resources:Resource, Bookmarks_MatchResult %>"
                ItemStyle-Width="45%" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:ImageButton ID="DeletePlayerButton" runat="server" OnClientClick='<%# DeleteBookMarkButtonOnClientClick()%>'
                        CommandArgument="<%#((GridViewRow) Container).RowIndex %>" CommandName="DeleteMatch"
                        ImageUrl="~/Images/Icons/delete.png" ToolTip="<%$ Resources:Resource, Global_Delete %>">
                    </asp:ImageButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            <asp:Label ID="NoMatcesMarkedLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_NoMatcesMarkedLabel %>"></asp:Label>
        </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="MatchesSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetBookmarkedMatches" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
    </div>
    </div>
    <div class="basic_element">
    <div class="red_title">
        <asp:Label ID="TeamsLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_TeamsLabel %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <asp:GridView ID="TeamsGridView" runat="server" DataSourceID="TeamsSqlDataSource"
            OnRowCommand="DeleteTeam" SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True"
            Font-Size="13px" EnableTheming="True" OnRowCreated="TeamsGridView_OnRowCreated">
            <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
            <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
            <Columns>
                <asp:BoundField DataField="BookmarkId" Visible="true" />
                <asp:TemplateField ItemStyle-Width="95%">
                    <HeaderTemplate>
                        <asp:Label ID="TeamNameTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_Team %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="TeamsHyperLink" runat="server" Text='<%# Eval("TeamName") %>' Visible='<%# Eval("BookmarkType").ToString() == "3" %>'
                            NavigateUrl='<%# Eval("TeamId", "TeamHomePage.aspx?TeamId={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                        <asp:HyperLink ID="NTLink" runat="server" Text='<%# Eval("TeamName") %>' Visible='<%# Eval("BookmarkType").ToString() == "7" %>'
                            NavigateUrl='<%# Eval("TeamId", "NationalTeam.aspx?TeamId={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-Width="5%">
                    <HeaderTemplate>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:ImageButton ID="DeleteTeamButton" runat="server" OnClientClick='<%# DeleteBookMarkButtonOnClientClick()%>'
                            CommandArgument="<%#((GridViewRow) Container).RowIndex %>" CommandName="DeleteTeam"
                            ImageUrl="~/Images/Icons/delete.png" ToolTip="<%$ Resources:Resource, Global_Delete %>">
                        </asp:ImageButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="NoTeamMarkedLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_NoTeamMarkedLabel %>"></asp:Label>
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="TeamsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetBookmarkedTeams" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
    </div>
    </div>
    <div class="basic_element">
    <div class="red_title">
     <asp:Label ID="UsersLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_UsersLabel %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <asp:GridView ID="UsersGridView" runat="server" DataSourceID="UsersSqlDataSource"
            OnRowCommand="DeleteUser" SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True"
            Font-Size="13px" EnableTheming="True" OnRowCreated="UsersGridView_OnRowCreated">
            <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
           <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
            <Columns>
                <asp:BoundField DataField="BookmarkId" Visible="true" />
                <asp:TemplateField ItemStyle-Width="95%">
                    <HeaderTemplate>
                        <asp:Label ID="UserNameTitleLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_UserNameTitleLabel %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="UsersHyperLink" runat="server" Text='<%# Eval("UserName") %>'
                            NavigateUrl='<%# Eval("UserId", "UserPage.aspx?Id={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:ImageButton ID="DeleteUserButton" runat="server" OnClientClick='<%# DeleteBookMarkButtonOnClientClick()%>'
                            CommandArgument="<%#((GridViewRow) Container).RowIndex %>" CommandName="DeleteUser"
                            ImageUrl="~/Images/Icons/delete.png" ToolTip="<%$ Resources:Resource, Global_Delete %>">
                        </asp:ImageButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="NoUserMarkedLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_NoUserMarkedLabel %>"></asp:Label>
                No Users were marked yet
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="UsersSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetBookmarkedUsers" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
    </div>
    </div>
    <div class="basic_element">
    <div class="red_title">
    <asp:Label ID="CoachesLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_CoachesLabel %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <asp:GridView ID="CoachesGridView" runat="server" DataSourceID="CoachesSqlDataSource"
            OnRowCommand="DeleteCoach" SkinID="Professional" AutoGenerateColumns="False"
            AllowPaging="True" EnableTheming="True" OnRowCreated="CoachesGridView_OnRowCreated">
            <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
            <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
            <Columns>
                <asp:BoundField DataField="BookmarkId" Visible="true" />
                <asp:TemplateField ItemStyle-Width="95%">
                    <HeaderTemplate>
                        <asp:Label ID="CoachNameTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_Coach %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="CoachesHyperLink" runat="server" Text='<%# Eval("CoachName") %>'
                            NavigateUrl='<%# Eval("CoachID", "Coach.aspx?Id={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-Width="5%">
                    <ItemTemplate>
                        <asp:ImageButton ID="DeleteCoachButton" runat="server" OnClientClick='<%# DeleteBookMarkButtonOnClientClick()%>'
                            CommandArgument="<%#((GridViewRow) Container).RowIndex %>" CommandName="DeleteCoach"
                            ImageUrl="~/Images/Icons/delete.png" ToolTip="<%$ Resources:Resource, Global_Delete %>">
                        </asp:ImageButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="NoCoachesMarkedLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_NoCoachesMarkedLabel %>"></asp:Label>
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="CoachesSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetBookmarkedCoaches" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
    </div>
    </div>
    <div class="basic_element">
    <div class="red_title">
        <asp:Label ID="LeaguesLabel" runat="server" Text="<%$ Resources:Resource, Global_Leagues %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <asp:GridView ID="LeaguesGridView" runat="server" DataSourceID="LeaguesSqlDataSource"
            OnRowCommand="DeleteLeague" SkinID="Professional" AutoGenerateColumns="False"
            AllowPaging="True" Font-Size="13px" EnableTheming="True" OnRowCreated="LeaguesGridView_OnRowCreated">
            <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
            <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
            <Columns>
                <asp:BoundField DataField="BookmarkId" Visible="true" />
                <asp:TemplateField ItemStyle-Width="95%">
                    <HeaderTemplate>
                        <asp:Label ID="LeagueNameTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_League %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="LeaguesHyperLink" runat="server" Text='<%# Eval("LeagueName") %>'
                            NavigateUrl='<%# Eval("LeagueID", "League.aspx?LeagueId={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                        &nbsp;
                        <asp:ImageButton ID="CountryImageButton" runat="server" ImageUrl='<%# Eval("Flag", "~/Images/Flags/{0}") %>'
                            PostBackUrl='<%# Eval("CountryId", "Country.aspx?CountryId={0}") %>' ToolTip='<%# Eval("CountryName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-Width="5%">
                    <HeaderTemplate>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:ImageButton ID="DeleteLeagueButton" runat="server" OnClientClick='<%# DeleteBookMarkButtonOnClientClick()%>'
                            CommandArgument="<%#((GridViewRow) Container).RowIndex %>" CommandName="DeleteLeague"
                            ImageUrl="~/Images/Icons/delete.png" ToolTip="<%$ Resources:Resource, Global_Delete %>">
                        </asp:ImageButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="NoLeaguesMarkedLabel" runat="server" Text="<%$ Resources:Resource, Bookmarks_NoLeaguesMarkedLabel %>"></asp:Label>
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="LeaguesSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetBookmarkedLeagues" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
    </div>
    </div>
    

    </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>
